package com.wetsion.securityoauthdemo.rmsclient.handler;

import com.wetsion.securityoauthdemo.rmsclient.common.UserDetails;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author weixin
 * @version 1.0
 * @CLassName DefaultUserDetailsGetter
 * @date 2019/3/8 7:01 PM
 */
public class DefaultUserDetailsGetter implements UserDetailsGetter {
    @Override
    public UserDetails handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        UserDetails userDetails = new UserDetails();
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        userDetails.setUsername(username);
        userDetails.setPassword(password);
        return userDetails;
    }
}
